class Stock1{
    public void Sell(){
        System.out.println("股票1卖出");
    }
    public void Buy(){
        System.out.println("股票1买入");
    }
}
class Stock2{
    public void Sell(){
        System.out.println("股票2卖出");
    }
    public void Buy(){
        System.out.println("股票2买入");
    }
}
class Stock3{
    public void Sell(){
        System.out.println("股票3卖出");
    }
    public void Buy(){
        System.out.println("股票3买入");
    }
}
class Fund{
    private Stock1 s1;
    private Stock2 s2;
    private Stock3 s3;

    public Fund() {
        s1 = new Stock1();
        s2 = new Stock2();
        s3 = new Stock3();
    }
    public void BuyFund(){
        s1.Buy();
        s2.Buy();
        s3.Buy();
    }
    public void SellFund(){
        s1.Sell();
        s2.Sell();
        s3.Sell();
    }
}
public class Test {
    public static void main(String[] args) {
        Fund f=new Fund();
        f.BuyFund();
        f.SellFund();
    }
}
